	protected function processForm(sfWebRequest $request, sfForm $form)
	{
		$form->bind($request->getParameter($form->getName()), $request->getFiles($form->getName()));
		if ($form->isValid())
		{
			$notice = $form->getObject()->isNew() ? 'El elemento se ha creado correctamente.' : 'El elemento se ha actualizado correctamente.';

			try {
				$<?php echo $this->getSingularName() ?> = $form->save();
			} catch (Doctrine_Validator_Exception $e) {

				$errorStack = $form->getObject()->getErrorStack();

				$message = get_class($form->getObject()) . ' has ' . count($errorStack) . " field" . (count($errorStack) > 1 ? 's' : null) . " with validation errors: ";
				foreach ($errorStack as $field => $errors) {
					$message .= "$field (" . implode(", ", $errors) . "), ";
				}
				$message = trim($message, ', ');

				$this->getUser()->setFlash('error', $message);
				return sfView::SUCCESS;
			}

			$this->dispatcher->notify(new sfEvent($this, 'admin.save_object', array('object' => $<?php echo $this->getSingularName() ?>)));

			if ($request->hasParameter('_save_and_add'))
			{
				$this->getUser()->setFlash('notice', $notice.' Ahora puede crear otro.');

				$this->redirect('@<?php echo $this->getUrlForAction('new') ?>');
			}
			else
			{
				$this->getUser()->setFlash('notice', $notice);
				$this->redirect(array('sf_route' => '<?php echo $this->getUrlForAction('show') ?>', 'sf_subject' => $<?php echo $this->getSingularName() ?>));
			}
		}
		else
		{
			$this->getUser()->setFlash('error', 'El elemento no se ha guardado porque se ha producido algún error.', false);
		}
	}
